﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BoletoElectronicoDesktop.TarjetasPremium
{
    public partial class FormTarjetasPremium : Form
    {
        public FormTarjetasPremium()
        {
            InitializeComponent();
        }

        private void FormTarjetasPremium_Load(object sender, EventArgs e)
        {
            //abro el formulario maximizado
            this.WindowState = FormWindowState.Maximized;

            for (int i = 1995; i <= 2100; i++)
                CbAño.Items.Add(i);
        }

        private void btnAnalizar_Click(object sender, EventArgs e)
        {
            if (CbAño.Text == "")
                MessageBox.Show("Seleccione un año");
            else
            {
                string año = CbAño.SelectedItem.ToString();
                DataTable tabla = TarjetaDAO.ObtenerTarjetasPremium(año);
                dataGridView1.DataSource = tabla;
            }
        }
    }
}
